using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class SEOrderEntryMap : EntityTypeConfiguration<SEOrderEntry>
    {
        public SEOrderEntryMap()
        {
            // Primary Key
            this.HasKey(t => t.FDetailID);

            // Properties
            this.Property(t => t.FBrNO)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FBatchNo)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.FMapNumber)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FMapName)
                .HasMaxLength(256);

            this.Property(t => t.FSourceBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FContractBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FGoodsDesc)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FMTONo)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FEntrySelfS0169)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfS0168)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("SEOrderEntry");
            this.Property(t => t.FBrNO).HasColumnName("FBrNO");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FQty).HasColumnName("FQty");
            this.Property(t => t.FCommitQty).HasColumnName("FCommitQty");
            this.Property(t => t.FPrice).HasColumnName("FPrice");
            this.Property(t => t.FAmount).HasColumnName("FAmount");
            this.Property(t => t.FTaxRate).HasColumnName("FTaxRate");
            this.Property(t => t.FTaxAmount).HasColumnName("FTaxAmount");
            this.Property(t => t.FTax).HasColumnName("FTax");
            this.Property(t => t.FDiscount).HasColumnName("FDiscount");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FDate).HasColumnName("FDate");
            this.Property(t => t.FDiscountAmount).HasColumnName("FDiscountAmount");
            this.Property(t => t.FInvoiceQty).HasColumnName("FInvoiceQty");
            this.Property(t => t.FBCommitQty).HasColumnName("FBCommitQty");
            this.Property(t => t.FTranLeadTime).HasColumnName("FTranLeadTime");
            this.Property(t => t.FATPDeduct).HasColumnName("FATPDeduct");
            this.Property(t => t.FCostObjectID).HasColumnName("FCostObjectID");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FAuxBCommitQty).HasColumnName("FAuxBCommitQty");
            this.Property(t => t.FAuxCommitQty).HasColumnName("FAuxCommitQty");
            this.Property(t => t.FAuxInvoiceQty).HasColumnName("FAuxInvoiceQty");
            this.Property(t => t.FAuxPrice).HasColumnName("FAuxPrice");
            this.Property(t => t.FAuxQty).HasColumnName("FAuxQty");
            this.Property(t => t.FUniDiscount).HasColumnName("FUniDiscount");
            this.Property(t => t.FFinalAmount).HasColumnName("FFinalAmount");
            this.Property(t => t.FSourceEntryID).HasColumnName("FSourceEntryID");
            this.Property(t => t.FHaveMrp).HasColumnName("FHaveMrp");
            this.Property(t => t.FStockQty).HasColumnName("FStockQty");
            this.Property(t => t.FAuxStockQty).HasColumnName("FAuxStockQty");
            this.Property(t => t.FBatchNo).HasColumnName("FBatchNo");
            this.Property(t => t.FCESS).HasColumnName("FCESS");
            this.Property(t => t.FAdviceConsignDate).HasColumnName("FAdviceConsignDate");
            this.Property(t => t.FBomInterID).HasColumnName("FBomInterID");
            this.Property(t => t.FMapNumber).HasColumnName("FMapNumber");
            this.Property(t => t.FMapName).HasColumnName("FMapName");
            this.Property(t => t.FLockFlag).HasColumnName("FLockFlag");
            this.Property(t => t.FInForeCast).HasColumnName("FInForeCast");
            this.Property(t => t.FAllAmount).HasColumnName("FAllAmount");
            this.Property(t => t.FAllStdAmount).HasColumnName("FAllStdAmount");
            this.Property(t => t.FAuxPropID).HasColumnName("FAuxPropID");
            this.Property(t => t.FAuxPriceDiscount).HasColumnName("FAuxPriceDiscount");
            this.Property(t => t.FPriceDiscount).HasColumnName("FPriceDiscount");
            this.Property(t => t.FQtyInvoice).HasColumnName("FQtyInvoice");
            this.Property(t => t.FQtyInvoiceBase).HasColumnName("FQtyInvoiceBase");
            this.Property(t => t.FTaxAmt).HasColumnName("FTaxAmt");
            this.Property(t => t.FAuxTaxPrice).HasColumnName("FAuxTaxPrice");
            this.Property(t => t.FTaxPrice).HasColumnName("FTaxPrice");
            this.Property(t => t.FReceiveAmountFor_Commit).HasColumnName("FReceiveAmountFor_Commit");
            this.Property(t => t.FReceiveAmount_Commit).HasColumnName("FReceiveAmount_Commit");
            this.Property(t => t.FSecCoefficient).HasColumnName("FSecCoefficient");
            this.Property(t => t.FSecQty).HasColumnName("FSecQty");
            this.Property(t => t.FSecCommitQty).HasColumnName("FSecCommitQty");
            this.Property(t => t.FSourceTranType).HasColumnName("FSourceTranType");
            this.Property(t => t.FSourceInterId).HasColumnName("FSourceInterId");
            this.Property(t => t.FSourceBillNo).HasColumnName("FSourceBillNo");
            this.Property(t => t.FContractInterID).HasColumnName("FContractInterID");
            this.Property(t => t.FContractEntryID).HasColumnName("FContractEntryID");
            this.Property(t => t.FContractBillNo).HasColumnName("FContractBillNo");
            this.Property(t => t.FMRPLockFlag).HasColumnName("FMRPLockFlag");
            this.Property(t => t.FMRPTrackFlag).HasColumnName("FMRPTrackFlag");
            this.Property(t => t.FOrderCommitQty).HasColumnName("FOrderCommitQty");
            this.Property(t => t.FOrderSecCommitQty).HasColumnName("FOrderSecCommitQty");
            this.Property(t => t.FAuxQtyInvoice).HasColumnName("FAuxQtyInvoice");
            this.Property(t => t.FCommitInstall).HasColumnName("FCommitInstall");
            this.Property(t => t.FAuxCommitInstall).HasColumnName("FAuxCommitInstall");
            this.Property(t => t.FMrpClosed).HasColumnName("FMrpClosed");
            this.Property(t => t.FAuxInCommitQty).HasColumnName("FAuxInCommitQty");
            this.Property(t => t.FInCommitQty).HasColumnName("FInCommitQty");
            this.Property(t => t.FSecInCommitQty).HasColumnName("FSecInCommitQty");
            this.Property(t => t.FApplyCommitQty).HasColumnName("FApplyCommitQty");
            this.Property(t => t.FAuxApplyCommitQty).HasColumnName("FAuxApplyCommitQty");
            this.Property(t => t.FSecApplyCommitQty).HasColumnName("FSecApplyCommitQty");
            this.Property(t => t.FEvaluated).HasColumnName("FEvaluated");
            this.Property(t => t.FPackUnitID).HasColumnName("FPackUnitID");
            this.Property(t => t.FPackCount).HasColumnName("FPackCount");
            this.Property(t => t.FPackType).HasColumnName("FPackType");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FMapID).HasColumnName("FMapID");
            this.Property(t => t.FGoodsDesc).HasColumnName("FGoodsDesc");
            this.Property(t => t.FAmountAfterDiscount).HasColumnName("FAmountAfterDiscount");
            this.Property(t => t.FInformCommitQty).HasColumnName("FInformCommitQty");
            this.Property(t => t.FAuxInformCommitQty).HasColumnName("FAuxInformCommitQty");
            this.Property(t => t.FSecInformCommitQty).HasColumnName("FSecInformCommitQty");
            this.Property(t => t.FPurCommitQty).HasColumnName("FPurCommitQty");
            this.Property(t => t.FAuxPurCommitQty).HasColumnName("FAuxPurCommitQty");
            this.Property(t => t.FSecPurCommitQty).HasColumnName("FSecPurCommitQty");
            this.Property(t => t.FMrpAutoClosed).HasColumnName("FMrpAutoClosed");
            this.Property(t => t.FSecStockQty).HasColumnName("FSecStockQty");
            this.Property(t => t.FSecInvoiceQty).HasColumnName("FSecInvoiceQty");
            this.Property(t => t.FSecCommitInstall).HasColumnName("FSecCommitInstall");
            this.Property(t => t.FPlanMode).HasColumnName("FPlanMode");
            this.Property(t => t.FMTONo).HasColumnName("FMTONo");
            this.Property(t => t.FEntrySelfS0161).HasColumnName("FEntrySelfS0161");
            this.Property(t => t.FEntrySelfS0162).HasColumnName("FEntrySelfS0162");
            this.Property(t => t.FEntrySelfS0163).HasColumnName("FEntrySelfS0163");
            this.Property(t => t.FEntrySelfS0164).HasColumnName("FEntrySelfS0164");
            this.Property(t => t.FEntrySelfS0166).HasColumnName("FEntrySelfS0166");
            this.Property(t => t.FEntrySelfS0169).HasColumnName("FEntrySelfS0169");
            this.Property(t => t.FEntrySelfS0168).HasColumnName("FEntrySelfS0168");
            this.Property(t => t.FEntrySelfS0170).HasColumnName("FEntrySelfS0170");
            this.Property(t => t.FEntrySelfS0171).HasColumnName("FEntrySelfS0171");
        }
    }
}
